package com.atguigu.config;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;

@Configuration
@EnableTransactionManagement
public class TransactionManagerConfig {
	
	@Autowired
	DataSource comboPooledDataSource;
	 @Bean  
	public PlatformTransactionManager PlatformTransactionManager() {
		 DataSourceTransactionManager pm=new DataSourceTransactionManager();
		 pm.setDataSource(comboPooledDataSource);
		 return pm;  	 
	}
}
